package com.health.system.dao.organiza;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import cn.org.rapid_framework.page.Page;
import cn.org.rapid_framework.page.PageRequest;

import com.health.system.javacommon.base.BaseIbatis3Dao;
import com.health.system.model.organiza.DataOrganizations;



/**
  * Title: 组织机构DAO 数据处理层 
  * Description : 执行./mapper/的DataOrganizationsMapper.xml的相应SQL语句
  * Copyright: Copyright (c) 2011-03 
  * Company: 
  * 
  * @author you name 
  * @version 1.0 
*/



@Component
public class DataOrganizationsDao extends BaseIbatis3Dao<DataOrganizations,java.lang.String>{

	public Class getEntityClass() {
		return DataOrganizations.class;
	}
	
	public void saveOrUpdate(DataOrganizations entity) {
		if(entity.getId() == null) 
			save(entity);
		else 
			update(entity);
	}
	
	/**
	* <p>批量删除<br>
	* Description : 
	* @param DataOrganizations u
	* @return int
	* @author Kingter
	*/
	public int removeByIdArry(DataOrganizations u) {
		int i=-1;
		i =delete("DataOrganizations.removeByIdArry", u);
		return i;
	}
	
	public Page findByPageRequest(PageRequest pageRequest) {
		return pageQuery("DataOrganizations.pageSelect",pageRequest);
	}
	
	public List userDataOrganizationsTree(Map map) {
		return getSqlSessionTemplate().selectList("DataOrganizations.userDataOrganizationsTree", map);
	}
	

}
